package com.ccy.legendary.game.imp;

import com.ccy.legendary.base.data.PersonsData;
import com.ccy.legendary.base.pojo.Person;
import com.ccy.legendary.base.pojo.PersonStatus;
import com.ccy.legendary.game.GameService;
import org.springframework.stereotype.Service;

import java.util.Map;

@Service
public class GameServiceImpl implements GameService {

    @Override
    public void initGame(String userCode) {
        Map<String, Person> personsData = PersonsData.getPersonData();
        personsData.put(userCode,createPerson(null));
    }

    @Override
    public Person createPerson(String personCode) {
        return createNormalPerson();
    }

    private Person createNormalPerson(){
        Person person = new Person();
        person.setId(0);
        person.setName("小白");
        person.setHp(10);
        person.setMp(5);
        person.setAgg(1);
        person.setDef(0);
        person.setRange(0);
        person.setRmb(0);
        person.setPersonStatus(PersonStatus.welcome);
        person.setOccupation("普通人");
        return person;
    }
}
